<template>
	<view class="search">
		<view class="uni-form-item uni-column">
			<uni-icons type="search" size="18" class="search-icon"></uni-icons>
			<input class="uni-input search-input" confirm-type="search" placeholder="请输入搜索关键字" :value="decodeURI(keyword)" @click="goToSearch()" />
		</view>
	</view>
</template>

<script>
	export default {
		name: 'Search',
		props: {
			title: {
				type: String,
				default: 'Search Text'
			},
			type: {
				type: String,
				default: 'Search',
			},
			keyword: {
				type: String,
				default: '',
			},
			api: {
				type: String,
				default: '',
			}
		},
		data() {
			return {
				keywordValue : ''
			}
		},
		created() {
			
		},
		methods: {
			
			goToSearch: function(){
				console.log('goto search page')
				let url = '../../pages/search/index'
				//指定跳转地址
				uni.navigateTo({
				    url: url
				});
				
			}
		}
	}
</script>

<style lang="scss">
	.search {
		position: relative;
		padding: 10rpx 20rpx;
		.search-input {
			border: 2rpx solid #fff;
			background-color: #f2f2f2;
			border-radius: 30rpx;
			padding: 12rpx 12rpx 12rpx 60rpx;
			font-size: 28rpx;
		}
		.search-icon {
			position: absolute;
			left: 36rpx;
			top: 24rpx;
			color: #000;
		}
	}
</style>
